@import '@/styles/utils.scss';

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px;

  height: 100%;
  display: flex;
  flex-direction: column;

  :global(.dark) & {
    color: #fff;
  }

  input[type="checkbox"] {
    appearance: none;
    /* 移除默认样式 */
    -webkit-appearance: none;
    /* 兼容 Safari */
    width: 16px;
    height: 16px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid #BDBDBD;
    box-shadow: none;

    &:checked {
      background: #0076fa;
      border: none;

      /* 自定义对勾图标 */
      &::after {
        content: "";
        position: absolute;
        left: 6px;
        top: 2px;
        width: 5px;
        height: 10px;
        border: solid #fff;
        border-width: 0 2px 2px 0;
        transform: rotate(39deg);
      }
    }

    // /* 悬停状态 */
    // &:hover {
    //   border: 1px solid #E3E3E3;
    // }

    /* 选中状态下的悬停 */
    &:checked:hover {
      background: #0061D8;
      border: none;
      /* 悬停时更亮的蓝色 */
    }

    :global(.dark) & {
      border: 1px solid #FFFFFF;

      /* 添加过渡效果 */

      /* 选中状态样式 */
      &:checked {
        background: #FFFFFF;
        border: none;

        /* 自定义对勾图标 */
        &::after {
          content: "";
          position: absolute;
          left: 6px;
          top: 2px;
          width: 5px;
          height: 10px;
          border: solid #1F2023;
          border-width: 0 2px 2px 0;
          transform: rotate(39deg);
        }
      }

      /* 悬停状态 */
      &:hover {
        border: 1px solid #fff;
      }

      /* 选中状态下的悬停 */
      &:checked:hover {
        background: #E3E3E3;
        border: none;
      }

    }
  }
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;

  h2 {
    font-weight: 500;
    font-size: 20px;
    color: #151515;
    line-height: 32px;
    text-align: left;

    :global(.dark) & {
      color: #fff;
    }
  }
}

.newChatButton {
  display: flex;
  align-items: center;
  background: #353535;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  :global(.dark) & {
    background: #1F2023;
    border: 1px solid #3F4245;
  }
  &:hover {
    background-color: #444;
    :global(.dark) & {
      background: #313234;
    }
  }
}


  .searchContainer {
    position: relative;
    margin-bottom: 24px;

    .searchInput {
      width: 100%;
      padding: 8px 12px 8px 36px;
      border: 1px solid rgba(0, 0, 0, 0.1);
      border-radius: 6px;
      font-size: 14px;
      outline: none;
      background-color: #fff;
      color: rgba(0, 0, 0, 0.8);
      height: 48px;

      :global(.dark) & {
        background-color: #2E3033;
        border-color: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.8);
      }

      &:focus ,&:hover{
        border-color: rgba(0, 0, 0);
        box-shadow: 0px 0px 0px 5px rgba(0,0,0, 0.08);;
        border-width: 1px;
  
        :global(.dark) & {
          border-color: rgba(255, 255, 255, 0.3);
          box-shadow: 0px 0px 0px 5px rgba(255, 255, 255, 0.08);;
          border-width: 1px;
        }
      }
    }

    .searchIcon {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: rgba(0, 0, 0, 0.5);
      width: 16px;
      height: 16px;

      :global(.dark) & {
        color: rgba(255, 255, 255, 0.5);
      }
    }
  }

.chatInfoHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;

  p {
    font-size: 14px;
    color: #0061D8;
    margin: 0;

    :global(.dark) & {
      color: #fff;
    }
  }
}

.actionButtons {
  display: flex;
  align-items: center;

  // gap: 10px;
  .otherActions {
    display: flex;
    transition: all 0.3s ease;
  }
}

.selectAllLabel {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  margin-right: 24px;

  :global(.dark) & {
    color: #fff;
  }

  input {
    margin-right: 5px;
  }
}

.deleteButton {
  background: none;
  border: none;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  // padding: 5px 10px;
  margin-right: 24px;

  :global(.dark) & {
    color: #fff;
  }

  &:disabled {
    color: #ccc;
    cursor: not-allowed;

    :global(.dark) & {
      color: #52525B;
    }
  }

  &:hover:not(:disabled) {
    color: #333;

    :global(.dark) & {
      color: #E4E4E7;
    }
  }
}

.selectButton {
  background: linear-gradient(180deg, #FFFFFF 0%, #EEF0F4 100%);
  border: 1px solid #D6DBE5;
  color: #353535;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  padding: 5px 10px;

  :global(.dark) & {
    color: #fff;
    background: #1F2023;
    border-radius: 8px;
    border: 1px solid #3F4245;
  }

  &:hover {
    background: #F3F3F3;
    border: 1px solid #E3E3E3;

    :global(.dark) & {
      // color: #E4E4E7;
      background: #313234;
      border: 1px solid #3F4245;
    }
  }
}

.chatList {
  display: flex;
  flex-direction: column;
  gap: 10px;
  // margin-bottom: 20px;
}

.chatItem {
  display: flex;
  border-radius: 8px;
  border: 1px solid #DEDEDE;
  background: #FAFAFA;
  overflow: hidden;
  transition: background 0.2s ease-in-out;
  cursor: pointer;

  :global(.dark) & {
    background: #2E3033;
    border: 1px solid #3F4245;
  }

  &:hover {
    background: #FFFFFF;

    :global(.dark) & {
      background: #3F4245;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
  }
}

.checkboxContainer {
  width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transform: translateX(-100%);
  /* 初始状态：隐藏在左侧 */
  transition: transform 0.3s ease, width 0.3s ease;

  /* 添加过渡效果 */
  input {
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease-in;
  }


  
}

  .checkboxContainerVisible {
    width: 46px;
    transform: translateX(0);

    input {
      opacity: 1;
    }
  }

  .chatContent {
    flex: 1;
    padding: 11px 16px;
    overflow: hidden;

    h3 {
      font-weight: 500;
      font-size: 16px;
      color: #000000;
      margin: 0 0 10px;
      cursor: pointer;

      :global(.dark) & {
        color: #fff;
      }
    }

    p {
      font-weight: 400;
      font-size: 14px;
      color: #8F8F8F;
      margin: 0 0 10px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;

      :global(.dark) & {
        color: #A1A1AA;
      }
    }
  }

  .chatDate {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #A1A1AA;
  }

  .dateIcon {
    margin-right: 5px;
    // background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>');
    // background-repeat: no-repeat;
    // background-position: center;
    // background-size: contain;
  }

  .viewAllContainer {
    display: flex;
    justify-content: center;
    transition: all 0.3s;
    overflow: hidden;
  }

  .viewAllButton {
    background: #EEEEEE;
    border: none;
    border-radius: 8px;
    width: 160px;
    height: 32px;
    font-size: 14px;
    text-align: center;
    line-height: 32px;
    color: #151515;
    cursor: pointer;

    :global(.dark) & {
      background: #1F2023;
      color: #fff;
      border: 1px solid #3F4245;
    }

    &:hover {
      background-color: #EEF0F4;

      :global(.dark) & {
        background: #313234;
      }
    }
  }


  .body {
    flex: 1;
    position: relative;

    .bodyCont {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      overflow-y: auto;
    }
  }


  .footerBox{
    // background-color: red;
    width: 20px;
    height: 20px;
    position: absolute;
    bottom: 0;
    left: 0;
  }